<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
    <meta name="renderer" content="webkit"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <title>用户搜索</title>
    <link rel="stylesheet" media="screen" href="/sousuo/css/style.css"/>
    <script src="/sousuo/js/jquery-1.10.1.min.js"></script>
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/index.css" rel="stylesheet">
    <link href="/peopleList/css/style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col-2">
            <a href="javascript:window.history.go(-1)">
                <span><i class="fa fa-times"></i></span>
            </a>
        </div>
        <div class="col-10">
            <div class="input-group-sm search">
                <input class=" form-control" placeholder="搜索用户名或邮箱" name="str">
                <button class="searchBtn">GO</button>
            </div>
        </div>
    </div>
</div>
<section class="aui-scrollView users" >
    <div class="aui-tab" data-ydui-tab id="total">
        <div class="tab-panel" id="listUser">
            <div class="tab-panel-item tab-active" render-loop="list">
                <a render-key="list.id" render-fun="getHref"
                   class="aui-flex b-line total">
                    <span style="display: none" render-html="list.id"></span>
                    <div class="aui-look-img">
                        <img render-src="list.headImgUrl" alt="">
                    </div>
                    <div class="aui-flex-box">
                        <h3 render-html="list.nickName"></h3>
                    </div>
                </a>
            </div>
        </div>
    </div>
</section>
<script>
    $(function () {
        $(".searchBtn").click(function () {
            var str = $("input[name='str']").val()
            $.get("/users/selects", {str: str}, function (data) {
                console.log(data);
                if (data) {
                    var list = {list: data};
                    $("#listUser").renderValues(list, {
                        getHref: function (item, value) {
                            $(item).prop("href", "/userProfiles.html?id=" + value);
                        }
                    });
                }
            })
        })
    })
</script>
</body>
</html>